-
Notifications
You must be signed in to change notification settings - Fork 41
RDKB-63098: Handle IPv6 delegation for business vs residential Partner ID as part of single build #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Reason for change: Added One Stack MACRO handling Test Procedure: - TBD Risks: None Priority: P3 Signed-off-by: rirfha948 <rasina_irfhan@comcast.com>
Reason for change: Added One Stack MACRO handling Test Procedure: - TBD Risks: None Priority: P3 Signed-off-by: rirfha948 <rasina_irfhan@comcast.com>
Reason for change: Added One Stack MACRO handling Test Procedure: - TBD Risks: None Priority: P3 Signed-off-by: rirfha948 <rasina_irfhan@comcast.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements runtime feature detection for IPv6 prefix delegation to enable a single build that supports both business (with IPv6 delegation) and residential (without IPv6 delegation) Partner IDs. The changes introduce the _ONESTACK_PRODUCT_REQ_ build flag along with runtime checks using isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) to dynamically select the appropriate code path based on the current operating mode.
Changes:
- Added runtime feature detection for IPv6 delegation using
isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)within_ONESTACK_PRODUCT_REQ_builds - Wrapped existing conditional compilation blocks (based on
CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) with runtime checks to support dynamic behavior selection - Updated preprocessor directives across multiple files to include
_ONESTACK_PRODUCT_REQ_alongside existing feature flags
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| source/service_routed/service_routed.c | Adds runtime checks for IPv6 delegation in route configuration, interface management, and zebra configuration generation; includes scope fix for last_broadcasted_prefix variable |
| source/service_ipv6/service_ipv6.c | Adds runtime checks for IPv6 delegation in DHCPv6 pool configuration and active LAN interface detection |
| source/scripts/init/c_registration/20_routing.c | Updates preprocessor directive to include _ONESTACK_PRODUCT_REQ_ for routing service event registration |
| source/scripts/init/c_registration/15_dhcpv6_server.c | Updates preprocessor directive to include _ONESTACK_PRODUCT_REQ_ for DHCPv6 server event registration |
| source/scripts/init/c_registration/15_dhcpv6_client.c | Updates preprocessor directive to include _ONESTACK_PRODUCT_REQ_ for DHCPv6 client event registration |
| source/firewall/firewall_ipv6.c | Adds runtime checks for IPv6 delegation in firewall rules; changes prepare_ipv6_multinet from static to non-static visibility |
| source/firewall/firewall.h | Updates function declaration for prepare_ipv6_multinet to match implementation changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #ifndef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION | ||
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional statement on this line lacks proper indentation. It should be indented to match the pattern used in other similar conditional blocks in this file (see lines 430, 459, 518, 675, 1027, 1037, etc.). The missing indentation makes the code structure less readable and inconsistent with the rest of the file.
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(MULTILAN_FEATURE) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif | ||
| { |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runtime feature check only evaluates FEATURE_IPV6_DELEGATION, but the preprocessor condition at line 516 also includes MULTILAN_FEATURE. This creates an inconsistency: if _ONESTACK_PRODUCT_REQ_ is defined alongside MULTILAN_FEATURE, and IPv6 delegation is disabled at runtime, this code block will not execute even though multi-LAN functionality may still be needed. Consider whether the runtime check should also account for multi-LAN requirements, or if the logic should be restructured to handle MULTILAN and PD features independently.
| #endif | ||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(MULTILAN_FEATURE) | ||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(MULTILAN_FEATURE) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runtime feature check only evaluates FEATURE_IPV6_DELEGATION, but the preprocessor condition at line 673 also includes MULTILAN_FEATURE. This creates the same inconsistency as seen in route_set: if _ONESTACK_PRODUCT_REQ_ is defined alongside MULTILAN_FEATURE, and IPv6 delegation is disabled at runtime, this cleanup code will not execute even though multi-LAN functionality may still require cleanup. The logic should be consistent with route_set and may need to handle MULTILAN independently of PD features.
| #ifdef _ONESTACK_PRODUCT_REQ_ | |
| #if defined(_ONESTACK_PRODUCT_REQ_) && !defined(MULTILAN_FEATURE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif | ||
| { |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When _ONESTACK_PRODUCT_REQ_ is enabled, this file calls isFeatureSupportedInCurrentMode() and references FEATURE_IPV6_DELEGATION, but it does not include the feature-gate header. This will fail to compile in C99+ due to missing declarations/macros. Add the appropriate #include <rdkb_feature_mode_gate.h> under the same _ONESTACK_PRODUCT_REQ_ guard (and ensure the service_routed binary links against the feature-gate library).
|
|
||
| if (pd_enabled || multilan_enabled) | ||
| { | ||
| get_active_lanif(sefd, setok, l2_insts, &enabled_iface_num); |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an _ONESTACK_PRODUCT_REQ_ build where MULTILAN_FEATURE is not defined, multilan_enabled stays 0 and pd_enabled can be 0 when IPv6 delegation is disabled. In that case this if (pd_enabled || multilan_enabled) block will be skipped, but it currently encloses the main per-interface zebra config generation (the block only closes much later), resulting in zebra.conf being written with just the base header and no interface RA configuration. Restructure so that the normal single-LAN zebra.conf generation still runs when PD is disabled; only the PD/multilan enumeration logic should be conditional.
| get_active_lanif(sefd, setok, l2_insts, &enabled_iface_num); | |
| get_active_lanif(sefd, setok, l2_insts, &enabled_iface_num); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same gating issue as route_set(): in ONESTACK builds this cleanup logic only runs when FEATURE_IPV6_DELEGATION is enabled. If MULTILAN_FEATURE is enabled but the feature gate is false, per-LAN IPv6 rules may be left behind on stop/restart. Consider conditioning this on multilan enabled OR PD enabled, not only on the PD feature gate.
| #ifdef _ONESTACK_PRODUCT_REQ_ | |
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| #ifdef _ONESTACK_PRODUCT_REQ_ | |
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) && !defined(MULTILAN_FEATURE) | |
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| #endif |
| syscfg_get(NULL, "ra_interval", ra_interval, sizeof(ra_interval)); | ||
| #ifdef CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION | ||
|
|
||
| #ifdef WAN_FAILOVER_SUPPORTED |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last_broadcasted_prefix is now declared unconditionally under WAN_FAILOVER_SUPPORTED, but in CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION builds (without ONESTACK_PRODUCT_REQ) the code paths that reference it are compiled out. This can introduce an unused-variable warning (and could fail builds that use -Werror). Consider moving the declaration into the non-PD branch where it’s used, or wrapping the declaration with the same preprocessor condition as its usages.
| #ifdef WAN_FAILOVER_SUPPORTED | |
| #if defined(WAN_FAILOVER_SUPPORTED) && (!defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)) |
| int prepare_ipv6_multinet(FILE *fp) | ||
| { | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| { | ||
| /* PD feature disabled */ | ||
| return 0; | ||
| } | ||
| #endif |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within prepare_ipv6_multinet(), the code later does a do/while loop that formats with the first token from strtok(active_insts, " "). If the sysevent value "multinet-instances" is empty, strtok returns NULL and that loop will dereference a NULL pointer. Add an early return when the first token is NULL (or switch to a while(token != NULL) loop).
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new ONESTACK_PRODUCT_REQ runtime gating (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) changes whether route rules are applied, but the existing gtest target for service_routed doesn’t compile with ONESTACK_PRODUCT_REQ and there are no unit tests covering the ONESTACK enabled/disabled branches. Add tests for both feature states to prevent regressions (including the MULTILAN_FEATURE interaction).
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == true) | ||
| #endif | ||
| { | ||
| DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "IAInterface", iface_name); | ||
| } | ||
| #endif | ||
| #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION) == false) | ||
| #endif | ||
| { | ||
| DHCPV6S_SYSCFG_GETS(DHCPV6S_NAME, "pool", cfg->index, "", 0, "Interface", iface_name); | ||
| } |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ONESTACK-specific behavior is now introduced in get_dhcpv6s_pool_cfg() to choose between IAInterface vs Interface based on FEATURE_IPV6_DELEGATION, but the existing service_ipv6 unit tests don’t build with ONESTACK_PRODUCT_REQ and don’t validate either branch. Add unit tests that exercise both feature states (mocking isFeatureSupportedInCurrentMode) to ensure the correct syscfg key is read.
source/service_routed/Makefile.am
Outdated
| AM_LDFLAGS = -lccsp_common -lsecure_wrapper | ||
|
|
||
|
|
||
|
|
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace and multiple blank lines were introduced around AM_LDFLAGS. Please trim whitespace and avoid extra blank lines to keep Makefile diffs clean and consistent.
| AM_LDFLAGS = -lccsp_common -lsecure_wrapper | |
| AM_LDFLAGS = -lccsp_common -lsecure_wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (3)
source/scripts/init/c_registration/20_routing.c:55
- With
_ONESTACK_PRODUCT_REQ_enabled, this switches the routed service’s custom event list to the prefix-delegation variant (includesdhcpv6_option_changedand omitsipv6_prefix|ipv6_nameserver). The default handler script in this repo (source/scripts/init/service.d/service_routed.sh) doesn’t handledhcpv6_option_changed, and it usesipv6_prefix|ipv6_nameserverto triggerradv-restart, so ONESTACK builds may miss RA/zebra refresh triggers. Consider registering a superset of events for ONESTACK (include both sets), or ensure the handler invoked in ONESTACK images supportsdhcpv6_option_changed.
#if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
"wan-status|/etc/utopia/service.d/service_routed.sh",
"lan-status|/etc/utopia/service.d/service_routed.sh",
"dhcpv6_option_changed|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
"ripd-restart|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
"zebra-restart|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
"staticroute-restart|/etc/utopia/service.d/service_routed.sh|NULL|"TUPLE_FLAG_EVENT,
NULL
source/scripts/init/c_registration/15_dhcpv6_server.c:54
- Including
_ONESTACK_PRODUCT_REQ_in this branch changes the dhcpv6_server registration to only listen fordhcpv6_option_changed. The handler referenced here (/etc/utopia/service.d/service_dhcpv6_server.sh, as shipped in this repo) does not handle that event, and instead restarts onlan-status|ipv6_nameserver|.... For ONESTACK builds where PD is disabled at runtime, this can prevent dhcpv6 server reconfig/restart on relevant changes. Consider using a combined event list for ONESTACK or aligning the handler script for ONESTACK images.
#elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
"dhcpv6_option_changed|/etc/utopia/service.d/service_dhcpv6_server.sh|NULL|"TUPLE_FLAG_EVENT,
NULL
};
source/scripts/init/c_registration/15_dhcpv6_client.c:66
- Including
_ONESTACK_PRODUCT_REQ_in this branch changes the dhcpv6_client registration toerouter_mode-updated|phylink_wan_state|.... The handler referenced here (/etc/utopia/service.d/service_dhcpv6_client.sh, as shipped in this repo) does not handle these events (it restarts onlan-status|wan-status|ipv6-status|...), so ONESTACK builds may not restart the client when expected. Consider registering the union of events for ONESTACK or ensuring the ONESTACK image uses a handler implementation that supports these events.
#elif defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_)
const char* SERVICE_CUSTOM_EVENTS[] = {
"erouter_mode-updated|/etc/utopia/service.d/service_dhcpv6_client.sh",
"phylink_wan_state|/etc/utopia/service.d/service_dhcpv6_client.sh",
"current_wan_ifname|/etc/utopia/service.d/service_dhcpv6_client.sh",
"bridge_mode|/etc/utopia/service.d/service_dhcpv6_client.sh",
NULL
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(MULTILAN_FEATURE) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif | ||
| { |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In _ONESTACK_PRODUCT_REQ_ builds where FEATURE_IPV6_DELEGATION is disabled at runtime, this #if ... || defined(_ONESTACK_PRODUCT_REQ_) block compiles in and the #elif !defined(WAN_MANAGER_UNIFICATION_ENABLED) legacy cleanup path is compiled out, so route_unset() will skip removing the default brlan0 IPv6 rule/route that route_set() may have added. Consider compiling both code paths for ONESTACK and selecting between them at runtime (similar to get_active_lanif() / gen_zebra_conf()), or refactor the legacy cleanup into a helper that can be called when the feature gate is false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #if defined(MULTILAN_FEATURE) || defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined (_ONESTACK_PRODUCT_REQ_) | ||
| int multilan_enabled = 0; | ||
| int pd_enabled = 0; | ||
|
|
||
| #if defined(MULTILAN_FEATURE) | ||
| multilan_enabled = 1; | ||
| #endif | ||
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) | ||
| pd_enabled = 1; | ||
| #endif | ||
|
|
||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| pd_enabled = isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION); | ||
| #endif | ||
|
|
||
| if (pd_enabled || multilan_enabled) | ||
| { | ||
| get_active_lanif(sefd, setok, l2_insts, &enabled_iface_num); | ||
| for (i = 0; i < enabled_iface_num; i++) | ||
| { |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new #if defined(MULTILAN_FEATURE) || defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) block starts an if (pd_enabled || multilan_enabled) / for (...) section, but later in this function there is an #endif that closes this preprocessor guard in the middle of that loop. With the new structure, that #endif will prematurely terminate the conditional compilation and can leave the closing braces under a different #if, causing build failures. Please re-audit the matching #if/#endif placement so the guard spans exactly the intended braces.
| int prepare_ipv6_multinet(FILE *fp) | ||
| { | ||
| #ifdef _ONESTACK_PRODUCT_REQ_ | ||
| if (!isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| { | ||
| /* PD feature disabled */ | ||
| return 0; | ||
| } | ||
| #endif | ||
| char active_insts[32] = {0}; | ||
| char lan_pd_if[128] = {0}; | ||
| char *p = NULL; |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In prepare_ipv6_multinet(), after p = strtok(active_insts, " ") the code uses a do { ... } while (...) loop further down. If active_insts is empty, p will be NULL and the first iteration will still execute, leading to undefined behavior when formatting %s with p. Add a NULL check before entering the loop or convert to while (p != NULL) so an empty instance list is handled safely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
source/service_routed/Makefile.am
Outdated
| $(top_builddir)/source/utctx/lib/libutctx.la \ | ||
| $(top_builddir)/source/ulog/libulog.la \ | ||
| -ltelemetry_msgsender | ||
| service_routed_LDFLAGS = -L${PKG_CONFIG_SYSROOT_DIR}$(libdir) -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
service_routed_LDFLAGS unconditionally links OneStack-specific libraries (-ldevicemode/-lonestack_* /-lrdkb_feature_mode_gate). This is inconsistent with other components (e.g., service_ipv6/firewall) that guard these libs behind the ONESTACK_PRODUCT_REQ automake conditional, and will break non-OneStack builds where these libs aren’t available. Gate these flags behind if ONESTACK_PRODUCT_REQ (and keep -lnet appended separately as needed).
| service_routed_LDFLAGS = -L${PKG_CONFIG_SYSROOT_DIR}$(libdir) -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate | |
| service_routed_LDFLAGS = -L${PKG_CONFIG_SYSROOT_DIR}$(libdir) | |
| if ONESTACK_PRODUCT_REQ | |
| service_routed_LDFLAGS += -ldevicemode -lonestack_syscfg -lonestack_log -lrdkb_feature_mode_gate | |
| endif |
| #ifdef WAN_FAILOVER_SUPPORTED | ||
| char last_broadcasted_prefix[64] = {0}; | ||
| #endif |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last_broadcasted_prefix is declared under #ifdef WAN_FAILOVER_SUPPORTED before the PD/non-PD compile-time split, but it is only referenced inside the non-PD branch (#if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) ...). In builds where WAN_FAILOVER_SUPPORTED and CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION are enabled (and _ONESTACK_PRODUCT_REQ_ is not), this becomes an unused local and can fail builds that treat warnings as errors. Move the declaration into the same preprocessor block(s) where it is used, or otherwise ensure it’s referenced in all compilation variants where it’s declared.
| sysevent_get(sefd, setok, "ipv6_prefix_prdtime", preferred_lft, sizeof(preferred_lft)); | ||
| sysevent_get(sefd, setok, "ipv6_prefix_vldtime", valid_lft, sizeof(valid_lft)); | ||
| #endif | ||
| syscfg_get(NULL, "lan_ifname", lan_if, sizeof(lan_if)); | ||
| } | ||
| #endif |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syscfg_get("lan_ifname", ...) is now inside the #if !defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) block. For CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION-only builds this means lan_if may never be initialized (unless later overwritten in the active-interface loop), but it is used after the loop (e.g., for the final "interface %s" stanza). Initialize lan_if unconditionally (or at least ensure it has a safe default) before any possible use when enabled_iface_num ends up 0.
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | ||
| #if defined(_ONESTACK_PRODUCT_REQ_) | ||
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | ||
| #endif | ||
| { | ||
| memset(name_servs, 0, sizeof(name_servs)); | ||
| } | ||
| #endif |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memset(name_servs, 0, ...) is now guarded by the PD-enabled path only. When PD is disabled (the non-PD branch), name_servs may retain data from earlier iterations before appending DNS server tokens, producing incorrect rdnss output. Clear name_servs unconditionally before populating it (e.g., once per interface iteration or before processing option values), not only when prefix delegation is enabled.
| #if defined(CISCO_CONFIG_DHCPV6_PREFIX_DELEGATION) || defined(_ONESTACK_PRODUCT_REQ_) | |
| #if defined(_ONESTACK_PRODUCT_REQ_) | |
| if (isFeatureSupportedInCurrentMode(FEATURE_IPV6_DELEGATION)) | |
| #endif | |
| { | |
| memset(name_servs, 0, sizeof(name_servs)); | |
| } | |
| #endif | |
| /* Clear name_servs before populating DNS server tokens for this option */ | |
| memset(name_servs, 0, sizeof(name_servs)); |
No description provided.